﻿using System;
using System.Linq;
using Controllers;

namespace Web
{
    public partial class DutyEdit : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            DutyController duty = new DutyController();
            IQueryable<DutyDTO> listData = duty.GetDutier();

            rptGaoGuan.DataSource = listData.Where(r => r.PosId<=4);//高管
            rptGaoGuan.DataBind();

            rptJingLi.DataSource = listData.Where(r => r.PosId <= 8 && r.PosId>=5);//值班经理
            rptJingLi.DataBind();

            rptXingZheng.DataSource = listData.Where(r => r.DeptId==21||r.DeptId==22);//行政中心
            rptXingZheng.DataBind();

            rptJieSuan.DataSource = listData.Where(r => r.DeptId == 17);//结算部
            rptJieSuan.DataBind();

            rptWuLiu.DataSource = listData.Where(r => r.DeptId == 39 || r.DeptId == 73 || r.DeptId == 74 || r.DeptId == 75 || r.DeptId == 52);//物流部
            rptWuLiu.DataBind();

            rptCaiWu.DataSource = listData.Where(r => r.DeptId == 34 || r.DeptId == 35 || r.DeptId ==67);//财务中心
            rptCaiWu.DataBind();

            rptYeWu.DataSource = listData.Where(r => r.DeptId == 18 || r.DeptId == 30);//业务部
            rptYeWu.DataBind();

            rptChanPing.DataSource = listData.Where(r => r.DeptId == 16);//产品部
            rptChanPing.DataBind();

            rptZhiYing.DataSource = listData.Where(r => r.DeptId == 19 || r.DeptId == 18);//直营店
            rptZhiYing.DataBind();

            rptHuiYi.DataSource = listData.Where(r => r.DeptId == 37);//会议管理部
            rptHuiYi.DataBind();
        }
    }
}